<template>
  <div>
    <div id="leiCharts">

    </div>
  </div>
</template>

<script setup>
    import {onMounted} from 'vue'
    import * as echarts from 'echarts'
    onMounted(()=>{
      makeCharts();
    })
// 生成图表方法
    let makeCharts=()=>{
      let mycharts=echarts.init(document.getElementById("leiCharts"))

      // 雷达图的配置项
      let option = {
          title: { //图标标题
            // text: 'Basic Radar Chart'
          },
          legend: { //图例组件
            data: ['本月满意度', '上月满意度'],
            bottom:-0,
            itemStyle:{
             
            },
            right:0,
            textStyle:{
                color:"#ffffff"
            }
          },
          // color:"#ffffff",
          radar: {
            radius: '55%', //调整雷达图的大小
            // shape: 'circle',
            // center: ['50%', '50%'],
            indicator: [ //雷达的指示器
              { name: '输出', max: 6500 },
              { name: '经济', max: 16000 },
              { name: '助攻', max: 30000 },
              { name: '防御塔', max: 38000 },
              { name: '承伤', max: 52000 },
              { name: '辅助', max: 25000 }
            ]
          },
          series: [
            {
              name: 'Budget vs spending',
              type: 'radar',
              areaStyle: { //区域的填充样式
                // color:"red"
              },
              data: [
                {
                  value: [4200, 3000, 20000, 35000, 50000, 18000],
                  name: '本月满意度'
                },
                {
                  value: [5000, 14000, 28000, 26000, 42000, 21000],
                  name: '上月满意度'
                }
              ]
            }
          ]
        };
        // 3 
        mycharts.setOption(option)
    }
</script>
<style lang="less" scoped>
  #leiCharts{
    width:220px;
    height: 230px;

  }
</style>
